<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 1.求1-100之间的所有数和的平均值
        let sum = 0;
        for (let i = 1; i <= 100; i++) {
            sum = sum + i;
        }
        console.log(sum / 100);
        // 2. 求1-100之间所有偶数和,奇数的和  偶数 even 奇数 odd
        let even = 0;
        let odd = 0;
        for (let i = 1; i <= 100; i++) {

            if (i % 2 == 0) {
                even = even + i;
            } else {
                odd = odd + i;
            }
        }
        console.log(even, odd);
        // 3. 求1-100之间所有能被3整除的数字的和 
        let sum1 = 0;
        for (let i = 1; i <= 100; i++) {

            if (i % 3 == 0) {
                sum1 = sum1 + i;
            }
        }
        console.log(sum1);
        // 4. 逢7过：7的倍数,个位是7的数字不输出。
        for (let i = 1; i <= 100; i++) {

            if ((i % 7 == 0) || (i % 10 == 7) || (parseInt(i / 10) == 7)) {
                console.log(i);
            }

        }
    </script>
</body>

</html>